home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 04 - 1988 / 04.02 Feb 88 / pascal sources / Plot Project Stuff / PlotGlobals < prev    next >
Encoding:
Text File  |  1988-01-07  |  2.9 KB  |  162 lines  |  [TEXT/PJMM]

  1. UNIT PlotGlobals;
  2.  
  3. INTERFACE
  4.  
  5.     USES
  6.         ROM85, PrintTraps;
  7.  
  8. { Global Constants }
  9.     CONST
  10.  
  11.     {multifinder stuff}
  12.         SysEnvTrap = $90;
  13.         WNETrapNum = $60;       {trap number of WaitNextEvent}
  14.         UnImplTrapNum = $9F;       {trap number of "unimplemented trap"}
  15.  
  16.     {window constants}
  17.         ZoomBox = 8;    {window type}
  18.         MinWidth = 80;
  19.         MinHeight = 80;
  20.         mBarHeightGlobal = $BAA;
  21.         GrayRgnLowMemGlobal = $9EE;
  22.         sBarWidth = 16;
  23.  
  24.         rsrc = 'PLTR';    {creator bytes restype}
  25.  
  26.     {dialog stuff}
  27.         AboutDialog = 256;
  28.         ParamDialog = 257;
  29.         MessageDialog = 258;
  30.         AlertDialog = 260;
  31.  
  32.     { menu res id's}
  33.         AppleMenu = 256;
  34.         FileMenu = 257;
  35.         EditMenu = 258;
  36.         ColorMenu = 259;
  37.         OptionMenu = 260;
  38.     {submenus id's}
  39.         GraphMenu = 44;
  40.         AxisMenu = 45;
  41.         BackgroundMenu = 46;
  42.  
  43.         MenuCount = 5;
  44.         SubMenuStart = 6;
  45.         TotalMenuCount = 8;
  46.         AppleM = 1;
  47.         FileM = 2;
  48.         EditM = 3;
  49.         ColorM = 4;
  50.         OptionM = 5;
  51.         GraphM = 6;
  52.         AxisM = 7;
  53.         BackGroundM = 8;
  54.  
  55. {menu items}
  56.         aAbout = 1;
  57.  
  58.         fPlot = 1;
  59.         fSave = 3;
  60.         fSaveAs = 4;
  61.         fPageSet = 5;
  62.         fPrint = 6;
  63.         fQuit = 8;
  64.  
  65.         eUndo = 1;
  66.         eCut = 3;
  67.         eCopy = 4;
  68.         ePaste = 5;
  69.         eClear = 6;
  70.  
  71.         oWindowRect = 1;
  72.         oPageRect = 2;
  73.  
  74. {Dialog Items}
  75.         dOK = 1;
  76.         dA = 2;
  77.         dB = 3;
  78.         dC = 4;
  79.         dSTEP = 5;
  80.         dXSCALE = 6;
  81.         dYSCALE = 7;
  82.  
  83.     TYPE
  84.  
  85.         Document = RECORD
  86.                 aParam : real;
  87.                 bParam : real;
  88.                 cParam : real;
  89.                 stepParam : real;
  90.                 xParam : integer;
  91.                 yParam : integer;
  92.                 drawing : PicHandle;
  93.                 print : THPrint;
  94.                 FileName : str255;
  95.                 volRefNum : integer;
  96.             END;
  97.         DocPtr = ^Document;
  98.         DocHandle = ^DocPtr;
  99.  
  100.         LongAndByte = RECORD
  101.                 CASE integer OF
  102.                     1 : (
  103.                             longView : LongInt
  104.                     );
  105.                     2 : (
  106.                             byteView : RECORD
  107.                                     byte0 : SignedByte;
  108.                                     byte1 : Signedbyte;
  109.                                     byte2 : Signedbyte;
  110.                                     byte3 : Signedbyte;
  111.                                 END;
  112.                     );
  113.             END;
  114.  
  115. { Global Variables }
  116.     VAR
  117.  
  118.     {my misc stuff}
  119.         Finished : boolean;
  120.         mBarHeight : Integer;
  121.  
  122.     {Multifinder stuff}
  123.         WNE : boolean; {Multifinder friendly}
  124.         SysEnv : boolean; {Multifinder friendly}
  125.         theWorld : SysEnvRec;    {not in LSP 1.11 }
  126.         typeOfMac : integer;
  127.         mouseRgn : RgnHandle; {cursor region to pass to WNE}
  128.  
  129.     {menu stuff}
  130.         myMenus : ARRAY[1..TotalMenuCount] OF MenuHandle;
  131.         GraphColor : integer;
  132.         AxisColor : integer;
  133.         BackgroundColor : integer;
  134.         color : ARRAY[1..8] OF LongInt;
  135.         Option : integer; {1 = windowrect, 2=pagerect}
  136.  
  137.     {rectangles}
  138.         DragArea : Rect;     {window drag area}
  139.         GrowArea : Rect;    {window grow area}
  140.         Screen : Rect;        {physical screen area}
  141.         PlotWindowRect : Rect;    {beginning window size}
  142.         ZoomRect : Rect;    {zoomed window size}
  143.         HCRect, VCRect, GrowRect : Rect; {scroller rects}
  144.         PicRect : Rect; {content region of window less scrollers}
  145.         PageRect : rect;
  146.  
  147. {dialogs stuff}
  148.         ItemHit : integer;
  149.         dialogflg : boolean;
  150.  
  151. {plot stuff}
  152.         a, b, c, x1, x2, check, step : real;
  153.         result, xscale, yscale : integer;
  154.         PlotWindow : WindowPtr;
  155.         PlotWindowPeek : WindowPeek;
  156.         PlotDocHandle : DocHandle;
  157.         DrawingPic : PicHandle;
  158.         PrintingPic : PicHandle;
  159.  
  160. IMPLEMENTATION
  161.  
  162. END.